from meiduo_admin.mypakge import *
from meiduo_admin.serializers.channel_serializers import *

# from rest_framework.viewsets import ModelViewSet
# from meiduo_admin.serializers.sku_serializer import *
# from goods.models import SKU,GoodsCategory
# from meiduo_admin.pages import MyPage
# from rest_framework.response import Response
# from rest_framework.generics import ListAPIView


# 获得频道列表展示
class CHANNEL___ChannelViewSet(ModelViewSet):
    queryset = GoodsChannel.objects.all()
    serializer_class = CHANNEL___ChannelModelSerialzier
    pagination_class = MyPage

    # def channel_types(self,request):




# class CHANNEL___ChannelView(ListAPIView):
#     queryset = GoodsChannel.objects.all()
#     serializer_class = CHANNEL___ChannelModelSerialzier

# 频道分组列表展示
class CHANNEL___ChannelTypesVeiw(ListAPIView):
    queryset = GoodsChannelGroup.objects.all()
    serializer_class = CHANNEL___ChannelTypeSerializer

    # def get_queryset(self):
    #     if self.action == 'channel_types':
    #         return
# 频道一级分类
class CHANNEL___CategoryView(ListAPIView):
    queryset = GoodsCategory.objects.all()
    serializer_class = SPUCategorySerializer
#
# class CHANNEL___ChannelViewSet(ModelViewSet):
#     queryset = GoodsChannel.objects.all()
#     serializer_class = CHANNEL___ChannelModelSerializer
#     pagination_class  = MyPage

